<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">
<h:head>
</h:head>
<ui:composition template="/WEB-INF/template/templateAdmin.xhtml">
	<ui:define name="content">
		<h:body>
			<f:view locale="#{language.locale}">
				<f:loadBundle basename="properties.messages" var="msg" />
				<div class="createRepBody">
					<div class="createRepTitle">#{msg.createRepository}</div>
					<br />
					<h:form id="formID">
						<h:panelGrid columns="3">
							<h:outputText value="#{msg.repNameLabel}"></h:outputText>
							<h:inputText id="repName" value="#{repositoryDTO.repName}"
								autocomplete="off">
								<f:validator binding="#{repNameValidator}"
									validatorId="repNameValidator" />
							</h:inputText>

							<h:message id="errorMessage2" for="repName" showSummary="true"
								showDetail="false"
								errorStyle="color:red; font-family: 'New Century Schoolbook', serif; font-style: oblique;">
							</h:message>

							<h:outputText value="#{msg.supNameLabel}:"></h:outputText>
							<h:inputText id="supID" value="#{repositoryDTO.userID}"
								autocomplete="off">
								<f:ajax event="keyup" render="userList"
									listener="#{repositoryDTOController.supNameListener}" />
								<f:validator binding="#{userNameValidator2}"
									validatorId="userNameValidator2"
									disabled="#{empty param['formID:createButton']}" />
							</h:inputText>

							<h:message id="errorMessage" for="supID" showSummary="true"
								showDetail="false"
								errorStyle="color:red; font-family: 'New Century Schoolbook', serif; font-style: oblique;">
							</h:message>
							<h:outputText></h:outputText>
							<h:selectOneMenu id="userList"
								value="#{repositoryDTOController.selectedUser}">
								<f:selectItems value="#{repositoryDTOController.matchingUsers}"></f:selectItems>
								<f:ajax event="change" render="supID userList"
									listener="#{repositoryDTOController.userListListener}"></f:ajax>
							</h:selectOneMenu>
<br/>
							<h:commandButton value="#{msg.createButton}"
								action="#{repositoryDTOController.addRepository}"
								class="selectRepositoryButton" id="createButton" />
						</h:panelGrid>
					</h:form>
				</div>
			</f:view>
		</h:body>
	</ui:define>
</ui:composition>
</html>